import request from '@/utils/request'

// 登录
export function loginAuth(params) {
	return request({
		url: '/api/oauth/Login',
		method: 'post',
		headers: {
		  "Content-Type": "application/x-www-form-urlencoded",
		},
		params: params
	})
}

// 注册
export function register(data) {
	return request({
		url: '/api/permission/Users/extend',
		method: 'post',
		data
	})
}

// export function register(data) {
// 	return request({
// 		url: '/api/oauth/register',
// 		method: 'post',
// 		data
// 	})
// }

// 退出登录
export function logout() {
	return request({
		url: '/api/oauth/Logout',
		method: 'get'
	})
}

// 修改密码
export function modifyPassword(data) {
	return request({
		url: '/api/permission/Users/Current/Actions/ModifyPassword',
		method: 'post',
		data
	})
}

// 获取当前用户信息
export function getInfo() {
  return request({
    url: "/api/oauth/CurrentUser",
    method: "get",
  });
}

// 根据key查询
export function getConfigByKeyName(data) {
  return request({
    url: `/api/system/SysConfig/getConfigByKeyName/${data}`,
    method: 'GET',
    data
  })
}


// 获取小程序openid的
export function getOpenid(params) {
	return request({
		url: '/api/wx/userInfo',
		method: 'get',
		params: params
	})
}
